<html>

<head>
  <script>
    window.onload = () => {
      webots.window('info').receive = function (message, robot) {
        if (message.startsWith('test')) {
          document.querySelector("#text-display").innerHTML = message;
          this.send("Answer: " + message, robot);
        } else
          console.log("Received unknown message for robot '" + robot + "': '" + message + "'");
      }
    }
  </script>
</head>

<body>
  <div>
    <h2>Info window</h2>
    <div>
      <p>Show message received from the controller:</p>
      <span id='text-display'></span>
    </div>
  </div>
</body>

</html>
